package org.mech.sefer.entity.bible.model.reference;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.mech.sefer.entity.bible.model.Bible;
import org.mech.sefer.entity.model.AbstractEntity;

@Entity
@Table(name = "T_REFS_VERSE_CROSS")
public class VerseCrossReference extends AbstractEntity {

	private static final long serialVersionUID = -8999171199654444457L;
	
	@Id
	@SequenceGenerator(name = "T_VERSE_CROSS_REFS_SEQ", sequenceName = "T_VERSE_CROSS_REFS_SEQ", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "T_VERSE_CROSS_REFS_SEQ")
	@Column(name = "ID", nullable = false, updatable = false)
	private Long id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BOOK_ATOM_REF_SRC_ID")
	private BookAtomRef source;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BOOK_ATOM_REF_DEST_ID")
	private BookAtomRef destination;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BIBLE_ID")
	private Bible originator;

	public BookAtomRef getSource() {
		return source;
	}

	public void setSource(BookAtomRef source) {
		this.source = source;
	}

	public BookAtomRef getDestination() {
		return destination;
	}

	public void setDestination(BookAtomRef destination) {
		this.destination = destination;
	}

	public Bible getOriginator() {
		return originator;
	}

	public void setOriginator(Bible originator) {
		this.originator = originator;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}
